#include<iostream>
#include<unistd.h>
#include<pthread.h>
using namespace std;

void *pthrun(void * args)
{
    string s=(char*)args;
    while(true)
    {
        cout<<"我是新线程"<<endl;
        sleep(1);
    }
    return nullptr;
}
int main()
{
    pthread_t pth;
    pthread_create(&pth,nullptr,pthrun,(void *)"pthread -1");

    while(true)
    {
        cout<<"我是主线程"<<endl;
        sleep(1);
    }
    return 0;
}